package com.openbravo.pos.inventory;

import com.openbravo.format.Formats;
import com.openbravo.pos.util.StringUtils;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

public class InventoryRecord
{
  private Date m_dDate;
  private MovementReason m_reason;
  private LocationInfo m_locationOri;
  private List<InventoryLine> m_invlines;

  public InventoryRecord(Date paramDate, MovementReason paramMovementReason, LocationInfo paramLocationInfo, List<InventoryLine> paramList)
  {
    this.m_dDate = paramDate;
    this.m_reason = paramMovementReason;
    this.m_locationOri = paramLocationInfo;
    this.m_invlines = paramList;
  }

  public Date getDate()
  {
    return this.m_dDate;
  }

  public MovementReason getReason()
  {
    return this.m_reason;
  }

  public LocationInfo getLocation()
  {
    return this.m_locationOri;
  }

  public List<InventoryLine> getLines()
  {
    return this.m_invlines;
  }

  public boolean isInput()
  {
    return this.m_reason.isInput();
  }

  public double getSubTotal()
  {
    double d = 0.0D;
    Iterator localIterator = this.m_invlines.iterator();
    while (localIterator.hasNext())
    {
      InventoryLine localInventoryLine = (InventoryLine)localIterator.next();
      d += localInventoryLine.getSubValue();
    }
    return d;
  }

  public String printDate()
  {
    return Formats.TIMESTAMP.formatValue(this.m_dDate);
  }

  public String printLocation()
  {
    return StringUtils.encodeXML(this.m_locationOri.toString());
  }

  public String printReason()
  {
    return StringUtils.encodeXML(this.m_reason.toString());
  }

  public String printSubTotal()
  {
    return Formats.CURRENCY.formatValue(new Double(getSubTotal()));
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.inventory.InventoryRecord
 * JD-Core Version:    0.6.0
 */